package com.imsx.controller.util;

import com.mongodb.DB;
import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
import java.io.IOException;
import java.util.Arrays;

public class TestDriver {
// To directly connect to a single MongoDB server (note that this will not auto-discover the primary even
// if it's a member of a replica set:

    public static void main(String[] args) throws IOException {

// or, to connect to a replica set, with auto-discovery of the primary, supply a seed list of members
        MongoClient mongoClient = new MongoClient(Arrays.asList(new ServerAddress("mongo0.example.com", 27017),
                new ServerAddress("mongo1.example.com", 27017),
                new ServerAddress("mongo2.example.com", 27017)));
        System.out.println("Detalles conectoon: " + mongoClient.getConnectPoint());
        

        DB db = mongoClient.getDB("amazondb");
        System.out.println("nombre BASE: " + db.getName());

    }
}
